#ifndef TRACE_FIU_HPP
#define TRACE_FIU_HPP

#include "trace/trace-driver.hpp"

/**
 * \file
 * \ingroup trace
 * cas::TraceFiu declaration.
 */

namespace cas
{
    /**
     * \ingroup trace
     */
    class TraceFiu : public TraceDriver
    {
    public:
        TraceFiu(std::string path = "");
        ~TraceFiu() override;

        size_t dataSize();
        void repeat(uint32_t n);

        /**
         * \brief FIU trace line structure
         */
        struct FiuData
        {
            uint64_t timestp;
            uint32_t inode;
            bool rw; /**< true = write, false = read */

            FiuData(uint64_t _timestp = 0, uint32_t _inode = 0, bool _rw = false)
                : timestp(_timestp), inode(_inode), rw(_rw){};
        };

        std::vector<FiuData> data; /**< trace data */

    private:
        bool parseLine(std::istringstream &sin) override;
    };
} // namespace cas

#endif /* TRACE_FIU_HPP */